// components/SalesBarChart.js
"use client";

import {
    BarChart,
    Bar,
    XAxis,
    YAxis,
    CartesianGrid,
    Tooltip,
    ResponsiveContainer
} from "recharts";

const salesData = [
    { month: "1月", value: 1100 },
    { month: "2月", value: 300 },
    { month: "3月", value: 200 },
    { month: "4月", value: 950 },
    { month: "5月", value: 1000 },
    { month: "6月", value: 250 },
    { month: "7月", value: 400 },
    { month: "8月", value: 1200 },
    { month: "9月", value: 300 },
    { month: "10月", value: 1100 },
    { month: "11月", value: 650 },
    { month: "12月", value: 750 }
];

const SalesBarChart = () => (
    <ResponsiveContainer width="100%" height="100%">
        <BarChart data={salesData}>
            <CartesianGrid strokeDasharray="3 3" />
            <XAxis dataKey="month" />
            <YAxis />
            <Tooltip />
            <Bar dataKey="value" fill="#f59e0b" />
        </BarChart>
    </ResponsiveContainer>
);

export default SalesBarChart;
//这段代码定义了一个名为 SalesBarChart 的 React 组件，用于在网页中渲染一个可视化的柱状图表。